﻿@model HomeControllerModel.Publish
<div class="ui-box  ui-box-alpha">
    <div class="ui-box-head">
        <div class="ui-box-head-border">
            <div class="ui-box-head-title">
                发产商品</div>
        </div>
    </div>
    <div class="ui-box-container-noborder">
        <div class="ui-box-content">
            <div class="row-fluid">
                <div class="span3">
                    <dl>
                        <dt>产品信息</dt><dd>as</dd></dl>
                </div>
                <div class="span9">
                    <form class="form-horizontal">
                    <dl>
                        <dt>基本信息</dt>
                        <dd>
                            <div class="control-group">
                                <label class="control-label" for="inputEmail">
                                    商品属性：</label>
                                <div class="controls">
                                    <div>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="inputEmail">
                                    商品图片：</label>
                                <div class="controls">
                                    <div>
                                    </div>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="inputEmail">
                                    商品描述：</label>
                                <div class="controls">
                                    <div>
                                    </div>
                                </div>
                            </div>
                        </dd>
                    </dl>
                    <dl>
                        <dt>其他信息</dt>
                        <dd>
                            <div class="control-group">
                                <label class="control-label">
                                    库存计数：</label>
                                <div class="controls">
                                    <p>
                                        <label class="radio">
                                            <input type="radio" name="subStock" value="0" checked="checked">
                                            拍下减库存
                                        </label>
                                    </p>
                                    <p>
                                        <label class="radio">
                                            <input type="radio" name="subStock" value="1">
                                            付款减库存
                                        </label>
                                    </p>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label">
                                    开始时间：</label>
                                <div class="controls">
                                    <p>
                                        <label class="radio">
                                            <input type="radio" name="onlineTime" value="0" checked="checked">
                                            立刻
                                        </label>
                                    </p>
                                    <p>
                                        <label class="radio">
                                            <input type="radio" name="onlineTime" value="">
                                            设定
                                        </label>
                                    </p>
                                    <p>
                                        <label class="radio">
                                            <input type="radio" name="onlineTime" value="1">
                                            放入仓库
                                        </label>
                                    </p>
                                </div>
                            </div>
                        </dd>
                    </dl>
                    <div class="control-group">
                        <div class="controls">
                            <label class="checkbox">
                                <input type="checkbox">
                                Remember me
                            </label>
                            <button type="submit" class="btn">
                                Sign in</button>
                        </div>
                    </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section css{
    <style type="text/css">
        
    </style>
}
@section js{
    <script type="text/javascript">
        var Ayatta = {};
        Ayatta.Props = {};
        function getChildren(obj, isRoot, isParent, parentId) {
            $(obj).addClass('category-tree-item-selected');
            $.postJSON('home/category/', { param: parentId, isParent: isParent }, function (result) {
                var categorys = result;
                if (!isParent) {
                    Ayatta.Props = result;
                }
                if (categorys != null && categorys.length > 0) {
                    var array = new Array();
                    array.push('<div class="span6"><div class="category-tree"><ul class="unstyled">');
                    var tpl = '<li class="category-tree-item" onclick="getChildren(this,false,{0},{1})">{2}</li>';
                    var brandTpl = '<li class="category-tree-item" onclick="getSubBrand(this,false,{0},{1})">{2}</li>';
                    $.each(categorys, function (i, n) {
                        if (isParent) {
                            array.push($.format(tpl, n.IsParent, n.Id, n.Name));
                        }
                        else {
                            if (n.Id == 20000 && n.Values != null) {
                                $.each(n.Values, function (i, n) {
                                    array.push($.format(brandTpl, 2000, n.Id, n.Name));
                                });
                            }
                        }
                    });
                    array.push("</ul></div></div>");
                    var html = array.join("");
                    if (isRoot) {
                        $("#category-container").empty();
                    }
                    else {
                        if ($("#category-container>div").length > 1) {
                            $("#category-container>div:last-child").remove();
                        }
                    }

                    $('#category-container').append(html);
                }
            });
        }
    </script>
}
